import request from '../utils/request'

// 获取基本资料--
const getUserIfoAPI = () => request({
  method: 'GET',
  url: '/v1_0/user'
})

// 获取用户基本信息
const getUserProfilrAPI = () => request({
  method: 'GET',
  url: '/v1_0/user/profile'
})

// 更新用户头像
const updateUserPhotoAPI = ({ form }) => request({
  method: 'PATCH',
  url: '/v1_0/user/photo',
  data: form
})

// 更新资料
const updateUserInfoAPI = ({ name, birthday }) => request({
  method: 'PATCH',
  url: '/v1_0/user/profile',
  data: {
    name,
    birthday
  }
})
export {
  getUserIfoAPI,
  getUserProfilrAPI,
  updateUserPhotoAPI,
  updateUserInfoAPI
}
